home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 2010 April
/
PCWorld0410.iso
/
pluginy Firefox
/
1843
/
1843.xpi
/
content
/
firebug
/
editorToContextMenu.js
< prev
next >
Wrap
Text File
|
2010-01-15
|
1KB
|
40 lines
/* See license.txt for terms of usage */
// Runs during overlay processing
function OpenEditorShowHide(event)
{
var item = document.getElementById("menu_firebugOpenWithEditor");
var popupNode = document.popupNode;
item.hidden = (popupNode instanceof HTMLInputElement
|| popupNode instanceof HTMLIFrameElement
|| popupNode instanceof HTMLTextAreaElement
|| Firebug.registeredEditors.length == 0);
}
function addOpenEditorShowHide(event)
{
window.removeEventListener("load", addOpenEditorShowHide, false);
var contextMenu = document.getElementById("contentAreaContextMenu");
if (contextMenu)
{
addContextToForms();
contextMenu.addEventListener("popupshowing", OpenEditorShowHide, false);
}
};
function addContextToForms(contextMenu)
{
// https://bugzilla.mozilla.org/show_bug.cgi?id=433168
var setTargetOriginal = nsContextMenu.prototype.setTarget;
nsContextMenu.prototype.setTarget = function(aNode, aRangeParent, aRangeOffset)
{
setTargetOriginal.apply(this, arguments);
if (this.isTargetAFormControl(aNode))
this.shouldDisplay = true;
};
}
window.addEventListener("load", addOpenEditorShowHide, false);